import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
  path: '*',
  redirect: '/'
},
//   {
//   path: '/',
//   redirect: '/dataPresentation'
// },
  {
    path: '/',
    component: () => import('../views/Login')
  },
  {
  path: '/home',
  name: 'Home',
  component: Home,
  children: [{
      path: '/batchingManagement',
      component: () => import('../views/Main/BatchingManagement.vue')
    }, {
      path: '/equipmentManagement',
      component: () => import('../views/Main/EquipmentManagement.vue')
    },
    {
      path: '/dataManagement',
      component: () => import('../views/Main/DataManagement.vue')
    },
    {
      path: '/roleManagement',
      component: () => import('../views/Main/RoleManagement.vue')
    },
    {
      path: '/jurisdictionManagement',
      component: () => import('../views/Main/JurisdictionManagement.vue')
    },
    {
      path: '/dataPresentation',
      component: () => import('../views/Main/DataPresentation.vue')
    },
    {
      path: '/systemFeedback',
      component: () => import('../views/Main/SystemFeedback.vue')
    }
  ]

}]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
